using System;
using System.Collections.Generic;
using FluentNHibernate.Mapping;

namespace chore.Domain
{
    public class Assignment : Occurrence
    {
        public virtual User AssignedTo { get; set; }
        public virtual bool Completed { get; set; }
        public virtual User CompletedBy { get; set; }
        public virtual IList<User> WithHelpFrom { get; set; }
        public virtual TimeSpan TimeElapsed { get; set; }
    }

    public class AssignmentMap : ClassMap<Assignment>
    {
        public AssignmentMap()
        {
            Id(a => a.Id).GeneratedBy.Identity();
            Map(a => a.Completed);
            Map(a => a.TimeElapsed);
            Map(a => a.Frequency);
            Map(a => a.Starting);

            References(a => a.CompletedBy);
            //References(a => a.WithHelpFrom);
            HasOne(a => a.AssignedTo);
            
        }
    }
}